import request from '@/utils/request'

export function query(data) {
  return request({
    url: `mes/sys/prove/query`,
    method: 'post',
    data
  })
}

/**
 * 新增或修改
 * @param data
 */
export function save(data) {
  return request({
    url: `mes/sys/prove/save`,
    method: 'put',
    data
  })
}
/**
 * 删除
 * @param data
 */
export function remove(data) {
  return request({
    url: `mes/sys/prove/delete`,
    method: 'delete',
    data
  })
}

export function queryUnConfigProve(data) {
  return request({
    url: `/mes/sys/prove/queryNotUserProveList`,
    method: 'post',
    data
  })
}
export function queryConfigProve(data) {
  return request({
    url: `/mes/sys/prove/queryUserProveList`,
    method: 'post',
    data
  })
}

/**
 * 保存用户分配证明
 * @param data.proveIds []
 * @param data.userId []
 */
export function saveConfigProve(data) {
  return request({
    url: `/system/iapSysUserT/saveUserProves`,
    method: 'put',
    data
  })
}
// 工位未拥有的证明
export function queryNotStationOfQuality(data) {
  return request({
    url: `mes/sys/prove/queryNotStationProveList`,
    method: 'post',
    data
  })
}
// 工位拥有的证明
export function queryStationOfQuality(data) {
  return request({
    url: `mes/sys/prove/queryStationProveList`,
    method: 'post',
    data
  })
}

/**
 * 保存工位证明
 * @param data.proveIds Array
 * @param data.stationBo String
 */
export function saveStationProve(data) {
  return request({
    url: `md/stations/saveStationProve`,
    method: 'post',
    data
  })
}

